package com.triangulator.gps;

import com.google.android.maps.GeoPoint;

import android.location.Location;

public class LatLong {
	double mLatitude;
	double mLongitude;
	double mOrientation;
	
	public LatLong(double latitude, double longitude, double orientation) {
		mLatitude = latitude;
		mLongitude = longitude;
		mOrientation = orientation;
	}
	
	public LatLong(double latitude, double longitude) {
		this(latitude, longitude, -1);
	}
	
	public LatLong(Location loc, double orientation) {
		mLatitude = loc.getLatitude();
		mLongitude = loc.getLongitude();
		mOrientation = orientation;
	}
	
	public double getLatitude() 	{ return mLatitude; }
	public double getLongitude() 	{ return mLongitude; }
	public int getLatitudeE6() 		{ return (int) (mLatitude * 1E6); }
	public int getLongitudeE6() 	{ return (int) (mLongitude * 1E6); }
	public double getOrientation() 	{ return mOrientation; }
	
	public GeoPoint getGeoPoint()	{ return new GeoPoint(getLatitudeE6(), getLongitudeE6()); }
	
	public String toString() { return "(" + mLatitude + ", " + mLongitude + ", " + mOrientation + ")"; }
}